home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / X / fonts / README < prev    next >
Encoding:
Text File  |  1994-08-02  |  2.5 KB  |  58 lines

  1.  
  2.                ~4Dgifts/toolbox/src/exampleCode/X/fonts README
  3.  
  4.  
  5.    glyph.c:
  6.   
  7.    A simple example of changing a window's cursor using "Glyph" cursors.  
  8.    A "Glyph" is just a character from one of the many text fonts that X 
  9.    knows about.  The size of your new glyph cursor is determined by the 
  10.    pixel size in the font's name.  This example should probably call 
  11.    `XQueryBestCursor()' to find the "best" (or at least the biggest usable) 
  12.    cursor size, but it simply arbitrarily chooses an Helvetica font with a 
  13.    pixel size of 25.  Note that some of the "character positions" in the 
  14.    array defining the characters in a font may be undefined, and among 
  15.    other things, a cursor must have non-zero width. So, after you load the 
  16.    font you've chosen, you need to query the "text extents" of each of the 
  17.    characters that might be defined in the font.  Also note that the first 
  18.    glyph cursor "displayed" by the program is the space character which has 
  19.    a width, but doesn't display a very interesting cursor.
  20.  
  21.  
  22.    scalable.c:
  23.  
  24.    This file contains a few simple examples of using scalable fonts
  25.    which were new to X11R5.  There are now two types of fonts:  bitmap
  26.    fonts and "derived instances of scalable fonts".  Note that for a
  27.    particular font specification it's not possible to determine whether
  28.    the font actually displayed is a bitmap font or a derived instance of
  29.    a scalable font.  
  30.    
  31.    In a list of fonts, the name string of a scalable font will have a `0'
  32.    in the PIXEL_SIZE, POINT_SIZE, and AVERAGE_WIDTH fields.
  33.    
  34.    When you specify a font name with wildcards, for scalable fonts, you
  35.    must provide a "well-formed" name.  A "well-formed" name is one in
  36.    which you specify all 14 hyphens in the name string.  To choose a
  37.    scalable font, put `0' in the PIXEL_SIZE, POINT_SIZE, and
  38.    AVERAGE_WIDTH fields.  
  39.    For example, 
  40.                   "-*-helvetica-medium-r-*-*-0-0-*-*-*-0-*-*"
  41.    
  42.    is a "well-formed" name.  A name that doesn't contain all 14 hyphens,
  43.    like:
  44.                   "-*-helvetica-medium-r-*"
  45.    
  46.    is not.
  47.    
  48.    The source file includes an example of using scalable fonts, and some
  49.    utility functions to help select a scalable font, determine whether a
  50.    font specification is "well-formed", and a few others.
  51.    
  52.    See the comments in the source for more information.
  53.    
  54.    See also, chapter 2 of the O'Reilly book:  "Programmer's Supplement
  55.    for Release 5 of the X Window System, Version 11", by David Flanagan.
  56.    
  57.    
  58.